package com.orphan.audit.dao;

import com.orphan.audit.po.SupplierInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wdn
 * @since 2021-07-16
 */

@Mapper
public interface SupplierInfoMapper extends BaseMapper<SupplierInfo> {

    @Select("select * from t_supplier_info")
    @Results(id = "supplierGoodsInfoMap",value = {
            @Result(column = "t_id",property = "tId",id = true),
            @Result(column = "t_goodsName",property = "tGoodsname"),
            @Result(column = "t_goodsNum",property = "tGoodsnum"),
            @Result(column = "t_goodsType",property = "tGoodstype"),
            @Result(column = "t_size",property = "tSize"),
            @Result(column = "t_price",property = "tPrice"),
            @Result(column = "fk_supplier_check",property = "supplierCheck",
                    one = @One(select = "com.orphan.audit.dao.SupplierCheckMapper.getById",
                            fetchType = FetchType.LAZY))
    })
    List<SupplierInfo> getAll();

}
